home *** CD-ROM | disk | FTP | other *** search
- Path: macromedia.com!news
- From: Mark Sanford <msanford@macromedia.com>
- Newsgroups: comp.lang.c++
- Subject: HELP!! Using STL with Visual C++ 4.1
- Date: Fri, 19 Apr 1996 14:09:44 -0700
- Organization: Macromedia
- Message-ID: <31780118.6204@macromedia.com>
- NNTP-Posting-Host: 207.3.33.142
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Macintosh; I; PPC)
-
- I'm trying to use the STL in my applications using the Visual
- C++ compiler. I've taken the steps suggested by Microsoft
- reguarding the use of namespaces and min/max definitions. But
- the compiler still chokes on line 124 of defalloc.h:
-
- 122 template <class T1, class T2>
- 123 inline void construct(T1* p, const T2& value) {
- 124 new (p) T1(value);
- 125 }
-
- The error is:
-
- error C2661: 'new' : no overloaded function takes 2 parameters
-
- This error comes up anytime I actually USE any of the STL
- templates. i.e. Simply adding this line of code causes the error:
-
- std::vector<int> x(10);
-
- I've tried STL sample code, and it causes the same error...
- BTW I looked in new.h (included in defalloc.h) and the new
- placement operator is defined:
-
- inline void * operator new( size_t, void * ptr ) { return ptr; }
-
- Has anybody else run into this problem? Any ideas on a solution?
-
- Mark Sanford
- msanford@macromedia.com
-